<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>DOM改变CSS属性</title>
</head>
<script type="text/javascript">
    function change(){
        document.getElementById("boom").style.backgroundColor = "blue";
        document.getElementById("boom").style.width = "500px";
        document.getElementById("boom").style.height = "200px";
    }
</script>
<style>
    .less{
        background-color: red;
        height: 200px;
        width: 300px;
    }
</style>
<body>
    <button type="button" onclick="change()">try me</button>
    <div class="less" id="boom">       </div>
</body>
</html>